<%-- 
    Document   : list
    Created on : Apr 10, 2012, 9:52:48 AM
    Author     : Yudi Retanto
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../header.jsp"></jsp:include>
    <!-- Container -->
    <script type="text/javascript">
        function updateProvinsi(){
            var id = $("#s-provinsi").val();
            if (id>0){
                $("#s-kabupaten").load("./admin?action=ajax&data=kabupaten&id_prov="+id);
            }
        }
    </script>
    <div id="container">
        <div class="shell">
            <!-- Main -->
            <div id="main">
                <div class="cl">&nbsp;</div>
                <!-- Content -->
                <div id="content">                   
                    <!-- Box -->
                    <div class="box">
                        <!-- Box Head -->
                        <div class="box-head">
                            <h2>Edit Unit Surveilans</h2>
                        </div>
                        <!-- End Box Head -->
                        <form action="./admin?action=edit_unit" method="post">
                            <!-- Form -->
                            <div class="form">
                                <p>
                                    <label>Nama Unit</label>
                                    <input type="text" class="field size1" name="nama" value="${unit.getNama()}"/>
                                </p>
                                <p class="inline-field">
                                    <label>Provinsi</label>
                                    <select id="s-provinsi" onchange="updateProvinsi()" class="field" name="prov">
                                        <c:forEach items="${provinsi}" var="p">
                                            <option <c:if test="${unit.getProvinsi()==p.getId()}">selected </c:if>value="${p.getId()}">${p.getNama()}</option>
                                        </c:forEach>
                                    </select>
                                </p>
                                <p class="inline-field">
                                    <label>Kabupaten</label>
                                    <select class="field" id="s-kabupaten" name="kab">
                                        <c:forEach items="${kabupaten}" var="k">
                                            <option <c:if test="${unit.getKabupaten()==k.getId()}">selected </c:if>value="${k.getId()}">${k.getNama()}</option>
                                        </c:forEach>
                                    </select>
                                </p>
                                <p>
                                    <label>Alamat</label>
                                    <input type="text" class="field size1" name="alamat" value="${unit.getAlamat()}"/>
                                </p>
                                <p>
                                    <label>Username Sistem</label>
                                    <input type="text" class="field size1" name="user" value="${unit.getUsername()}"/>
                                </p>
                                <p>
                                    <label>Password Sistem</label>
                                    <input type="text" class="field size1" name="pwd" value=""/>
                                    <input type="hidden" class="field size1" name="id" value="${unit.getId()}"/>
                                </p>
                            </div>
                            <!-- End Form -->
                            <!-- Form Buttons -->
                            <div class="buttons">
                                <input type="submit" class="button" value="submit" />
                            </div>
                            <!-- End Form Buttons -->
                        </form>
                    </div>
                    <!-- End Box -->
                </div>
                <!-- End Content -->
                <div class="cl">&nbsp;</div>			
            </div>
            <!-- Main -->
        </div>
    </div>
    <!-- End Container -->
<jsp:include page="../footer.jsp"></jsp:include>